﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="QuarterlyOrdersFormDataSet" targetNamespace="http://tempuri.org/QuarterlyOrdersFormDataSet.xsd" xmlns:mstns="http://tempuri.org/QuarterlyOrdersFormDataSet.xsd" xmlns="http://tempuri.org/QuarterlyOrdersFormDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="NorthwindNETConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="NorthwindNETConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.Northwind.NET.FE.Properties.Settings.GlobalReference.Default.NorthwindNETConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="CustomerOrderYearTableAdapter" GeneratorDataComponentClassName="CustomerOrderYearTableAdapter" Name="CustomerOrderYear" UserDataComponentName="CustomerOrderYearTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="NorthwindNETConnectionString (Settings)" DbObjectName="NorthwindNET.dbo.Customer" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByYear" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetDataByYear" GeneratorSourceName="FillByYear" GetMethodModifier="Public" GetMethodName="GetDataByYear" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetDataByYear" UserSourceName="FillByYear">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT DISTINCT Customer.ID, Customer.Name, Customer.City, Customer.Country, YEAR([Order].OrderDate) AS OrderYear
FROM         Customer INNER JOIN
                      [Order] ON Customer.ID = [Order].CustomerId
WHERE     (YEAR([Order].OrderDate) = @OrderYear)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="OrderYear" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="Decimal" Direction="Input" ParameterName="@OrderYear" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ID" DataSetColumn="ID" />
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
              <Mapping SourceColumn="City" DataSetColumn="City" />
              <Mapping SourceColumn="Country" DataSetColumn="Country" />
              <Mapping SourceColumn="OrderYear" DataSetColumn="OrderYear" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="OrderProductQuarterTableAdapter" GeneratorDataComponentClassName="OrderProductQuarterTableAdapter" Name="OrderProductQuarter" UserDataComponentName="OrderProductQuarterTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="NorthwindNETConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT     [Order].CustomerId, YEAR([Order].OrderDate) AS OrderYear, Product.Name AS ProductName, SUM(CONVERT(money, (CASE WHEN (DATEPART(quarter, 
                      [Order].OrderDate) = 1) THEN OrderDetail.UnitPrice * Quantity * (1 - Discount) / 100 ELSE 0 END)) * 100) AS OrderSumQ1, SUM(CONVERT(money, 
                      (CASE WHEN (DATEPART(quarter, [Order].OrderDate) = 2) THEN OrderDetail.UnitPrice * Quantity * (1 - Discount) / 100 ELSE 0 END)) * 100) 
                      AS OrderSumQ2, SUM(CONVERT(money, (CASE WHEN (DATEPART(quarter, [Order].OrderDate) = 3) THEN OrderDetail.UnitPrice * Quantity * (1 - Discount)
                       / 100 ELSE 0 END)) * 100) AS OrderSumQ3, SUM(CONVERT(money, (CASE WHEN (DATEPART(quarter, [Order].OrderDate) = 4) 
                      THEN OrderDetail.UnitPrice * Quantity * (1 - Discount) / 100 ELSE 0 END)) * 100) AS OrderSumQ4
FROM         [Order] INNER JOIN
                      OrderDetail ON [Order].ID = OrderDetail.OrderID INNER JOIN
                      Product ON OrderDetail.ProductID = Product.ID
GROUP BY [Order].CustomerId, YEAR([Order].OrderDate), Product.Name</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="CustomerId" DataSetColumn="CustomerId" />
              <Mapping SourceColumn="OrderYear" DataSetColumn="OrderYear" />
              <Mapping SourceColumn="ProductName" DataSetColumn="ProductName" />
              <Mapping SourceColumn="OrderSumQ1" DataSetColumn="OrderSumQ1" />
              <Mapping SourceColumn="OrderSumQ2" DataSetColumn="OrderSumQ2" />
              <Mapping SourceColumn="OrderSumQ3" DataSetColumn="OrderSumQ3" />
              <Mapping SourceColumn="OrderSumQ4" DataSetColumn="OrderSumQ4" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ActivityYearTableAdapter" GeneratorDataComponentClassName="ActivityYearTableAdapter" Name="ActivityYear" UserDataComponentName="ActivityYearTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="NorthwindNETConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT DISTINCT YEAR([Order].OrderDate) AS ActivityYear
FROM         Customer INNER JOIN
                      [Order] ON Customer.ID = [Order].CustomerId
ORDER BY ActivityYear DESC</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ActivityYear" DataSetColumn="ActivityYear" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="QuarterlyOrdersFormDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="QuarterlyOrdersFormDataSet" msprop:Generator_DataSetName="QuarterlyOrdersFormDataSet" msprop:EnableTableAdapterManager="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CustomerOrderYear" msdata:Locale="" msprop:Generator_UserTableName="CustomerOrderYear" msprop:Generator_RowDeletedName="CustomerOrderYearRowDeleted" msprop:Generator_RowChangedName="CustomerOrderYearRowChanged" msprop:Generator_RowClassName="CustomerOrderYearRow" msprop:Generator_RowChangingName="CustomerOrderYearRowChanging" msprop:Generator_RowEvArgName="CustomerOrderYearRowChangeEvent" msprop:Generator_RowEvHandlerName="CustomerOrderYearRowChangeEventHandler" msprop:Generator_TableClassName="CustomerOrderYearDataTable" msprop:Generator_TableVarName="tableCustomerOrderYear" msprop:Generator_RowDeletingName="CustomerOrderYearRowDeleting" msprop:Generator_TablePropName="CustomerOrderYear">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" />
              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="40" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="City" msprop:Generator_UserColumnName="City" msprop:Generator_ColumnPropNameInRow="City" msprop:Generator_ColumnVarNameInTable="columnCity" msprop:Generator_ColumnPropNameInTable="CityColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Country" msprop:Generator_UserColumnName="Country" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInTable="CountryColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OrderYear" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderYear" msprop:Generator_ColumnPropNameInRow="OrderYear" msprop:Generator_ColumnVarNameInTable="columnOrderYear" msprop:Generator_ColumnPropNameInTable="OrderYearColumn" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="OrderProductQuarter" msdata:Locale="" msprop:Generator_UserTableName="OrderProductQuarter" msprop:Generator_RowDeletedName="OrderProductQuarterRowDeleted" msprop:Generator_RowChangedName="OrderProductQuarterRowChanged" msprop:Generator_RowClassName="OrderProductQuarterRow" msprop:Generator_RowChangingName="OrderProductQuarterRowChanging" msprop:Generator_RowEvArgName="OrderProductQuarterRowChangeEvent" msprop:Generator_RowEvHandlerName="OrderProductQuarterRowChangeEventHandler" msprop:Generator_TableClassName="OrderProductQuarterDataTable" msprop:Generator_TableVarName="tableOrderProductQuarter" msprop:Generator_RowDeletingName="OrderProductQuarterRowDeleting" msprop:Generator_TablePropName="OrderProductQuarter">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CustomerId" msprop:Generator_UserColumnName="CustomerId" msprop:Generator_ColumnPropNameInRow="CustomerId" msprop:Generator_ColumnVarNameInTable="columnCustomerId" msprop:Generator_ColumnPropNameInTable="CustomerIdColumn" type="xs:int" minOccurs="0" />
              <xs:element name="OrderYear" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderYear" msprop:Generator_ColumnPropNameInRow="OrderYear" msprop:Generator_ColumnVarNameInTable="columnOrderYear" msprop:Generator_ColumnPropNameInTable="OrderYearColumn" type="xs:int" minOccurs="0" />
              <xs:element name="ProductName" msprop:Generator_UserColumnName="ProductName" msprop:Generator_ColumnPropNameInRow="ProductName" msprop:Generator_ColumnVarNameInTable="columnProductName" msprop:Generator_ColumnPropNameInTable="ProductNameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="40" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OrderSumQ1" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderSumQ1" msprop:Generator_ColumnPropNameInRow="OrderSumQ1" msprop:Generator_ColumnVarNameInTable="columnOrderSumQ1" msprop:Generator_ColumnPropNameInTable="OrderSumQ1Column" type="xs:decimal" minOccurs="0" />
              <xs:element name="OrderSumQ2" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderSumQ2" msprop:Generator_ColumnPropNameInRow="OrderSumQ2" msprop:Generator_ColumnVarNameInTable="columnOrderSumQ2" msprop:Generator_ColumnPropNameInTable="OrderSumQ2Column" type="xs:decimal" minOccurs="0" />
              <xs:element name="OrderSumQ3" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderSumQ3" msprop:Generator_ColumnPropNameInRow="OrderSumQ3" msprop:Generator_ColumnVarNameInTable="columnOrderSumQ3" msprop:Generator_ColumnPropNameInTable="OrderSumQ3Column" type="xs:decimal" minOccurs="0" />
              <xs:element name="OrderSumQ4" msdata:ReadOnly="true" msprop:Generator_UserColumnName="OrderSumQ4" msprop:Generator_ColumnPropNameInRow="OrderSumQ4" msprop:Generator_ColumnVarNameInTable="columnOrderSumQ4" msprop:Generator_ColumnPropNameInTable="OrderSumQ4Column" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ActivityYear" msdata:Locale="" msprop:Generator_UserTableName="ActivityYear" msprop:Generator_RowDeletedName="ActivityYearRowDeleted" msprop:Generator_TableClassName="ActivityYearDataTable" msprop:Generator_RowChangedName="ActivityYearRowChanged" msprop:Generator_RowClassName="ActivityYearRow" msprop:Generator_RowChangingName="ActivityYearRowChanging" msprop:Generator_RowEvArgName="ActivityYearRowChangeEvent" msprop:Generator_RowEvHandlerName="ActivityYearRowChangeEventHandler" msprop:Generator_TablePropName="ActivityYear" msprop:Generator_TableVarName="tableActivityYear" msprop:Generator_RowDeletingName="ActivityYearRowDeleting">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ActivityYear" msdata:ReadOnly="true" msprop:Generator_UserColumnName="ActivityYear" msprop:Generator_ColumnPropNameInRow="ActivityYear" msprop:Generator_ColumnVarNameInTable="columnActivityYear" msprop:Generator_ColumnPropNameInTable="ActivityYearColumn" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:CustomerOrderYear" />
      <xs:field xpath="mstns:ID" />
    </xs:unique>
  </xs:element>
  <xs:annotation>
    <xs:appinfo>
      <msdata:Relationship name="CustomerOrderYear_OrderProductQuarter" msdata:parent="CustomerOrderYear" msdata:child="OrderProductQuarter" msdata:parentkey="ID OrderYear" msdata:childkey="CustomerId OrderYear" msprop:Generator_UserRelationName="CustomerOrderYear_OrderProductQuarter" msprop:Generator_RelationVarName="relationCustomerOrderYear_OrderProductQuarter" msprop:Generator_UserChildTable="OrderProductQuarter" msprop:Generator_UserParentTable="CustomerOrderYear" msprop:Generator_ParentPropName="CustomerOrderYearRowParent" msprop:Generator_ChildPropName="GetOrderProductQuarterRows" />
    </xs:appinfo>
  </xs:annotation>
</xs:schema>